/**
 *
 */
import Util;
import OSS;
import OpenPlatform;
import OSSUtil;
import FileForm;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'docmind-api.aliyuncs.com',
    ap-northeast-2-pop = 'docmind-api.aliyuncs.com',
    ap-south-1 = 'docmind-api.aliyuncs.com',
    ap-southeast-1 = 'docmind-api.aliyuncs.com',
    ap-southeast-2 = 'docmind-api.aliyuncs.com',
    ap-southeast-3 = 'docmind-api.aliyuncs.com',
    ap-southeast-5 = 'docmind-api.aliyuncs.com',
    cn-beijing = 'docmind-api.aliyuncs.com',
    cn-beijing-finance-1 = 'docmind-api.aliyuncs.com',
    cn-beijing-finance-pop = 'docmind-api.aliyuncs.com',
    cn-beijing-gov-1 = 'docmind-api.aliyuncs.com',
    cn-beijing-nu16-b01 = 'docmind-api.aliyuncs.com',
    cn-chengdu = 'docmind-api.aliyuncs.com',
    cn-edge-1 = 'docmind-api.aliyuncs.com',
    cn-fujian = 'docmind-api.aliyuncs.com',
    cn-haidian-cm12-c01 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-finance = 'docmind-api.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'docmind-api.aliyuncs.com',
    cn-hangzhou-test-306 = 'docmind-api.aliyuncs.com',
    cn-hongkong = 'docmind-api.aliyuncs.com',
    cn-hongkong-finance-pop = 'docmind-api.aliyuncs.com',
    cn-huhehaote = 'docmind-api.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'docmind-api.aliyuncs.com',
    cn-north-2-gov-1 = 'docmind-api.aliyuncs.com',
    cn-qingdao = 'docmind-api.aliyuncs.com',
    cn-qingdao-nebula = 'docmind-api.aliyuncs.com',
    cn-shanghai = 'docmind-api.aliyuncs.com',
    cn-shanghai-et15-b01 = 'docmind-api.aliyuncs.com',
    cn-shanghai-et2-b01 = 'docmind-api.aliyuncs.com',
    cn-shanghai-finance-1 = 'docmind-api.aliyuncs.com',
    cn-shanghai-inner = 'docmind-api.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'docmind-api.aliyuncs.com',
    cn-shenzhen = 'docmind-api.aliyuncs.com',
    cn-shenzhen-finance-1 = 'docmind-api.aliyuncs.com',
    cn-shenzhen-inner = 'docmind-api.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'docmind-api.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'docmind-api.aliyuncs.com',
    cn-wuhan = 'docmind-api.aliyuncs.com',
    cn-wulanchabu = 'docmind-api.aliyuncs.com',
    cn-yushanfang = 'docmind-api.aliyuncs.com',
    cn-zhangbei = 'docmind-api.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'docmind-api.aliyuncs.com',
    cn-zhangjiakou = 'docmind-api.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'docmind-api.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'docmind-api.aliyuncs.com',
    eu-central-1 = 'docmind-api.aliyuncs.com',
    eu-west-1 = 'docmind-api.aliyuncs.com',
    eu-west-1-oxs = 'docmind-api.aliyuncs.com',
    me-east-1 = 'docmind-api.aliyuncs.com',
    rus-west-1-pop = 'docmind-api.aliyuncs.com',
    us-east-1 = 'docmind-api.aliyuncs.com',
    us-west-1 = 'docmind-api.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('docmind-api', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ExtractFeedbackRequest {
  feedbackUrl?: string(name='FeedbackUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model ExtractFeedbackAdvanceRequest {
  feedbackUrlObject?: readable(name='FeedbackUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model ExtractFeedbackResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model ExtractFeedbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExtractFeedbackResponseBody(name='body'),
}

async function extractFeedbackWithOptions(request: ExtractFeedbackRequest, runtime: Util.RuntimeOptions): ExtractFeedbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.feedbackUrl)) {
    query['FeedbackUrl'] = request.feedbackUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExtractFeedback',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function extractFeedback(request: ExtractFeedbackRequest): ExtractFeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return extractFeedbackWithOptions(request, runtime);
}

async function extractFeedbackAdvance(request: ExtractFeedbackAdvanceRequest, runtime: Util.RuntimeOptions): ExtractFeedbackResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var extractFeedbackReq = new ExtractFeedbackRequest{};
  OpenApiUtil.convert(request, extractFeedbackReq);

  if(!Util.isUnset(request.feedbackUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.feedbackUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    extractFeedbackReq.feedbackUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var extractFeedbackResp = extractFeedbackWithOptions(extractFeedbackReq, runtime);
  return extractFeedbackResp;
}

model GetSingleDocumentExtractResultRequest {
  id?: string(name='Id', example='docmind-20220816-1e89d65c'),
}

model GetSingleDocumentExtractResultResponseBody = {
  code?: string(name='Code', example='noPermission'),
  completed?: boolean(name='Completed', example='true'),
  data?: any(name='Data', example='{
  "RequestId": "2AABD2C2-D24F-12F7-875D-683A27C3****",
  "Completed": false,
  "Code": "DocProcessing",
  "Message": "Document processing",
  "HostId": "ocr-api.cn-hangzhou.aliyuncs.com",
  "Recommend": "https://next.api.aliyun.com/troubleshoot?q=DocProcessing&product=docmind-api"
}'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
  status?: string(name='Status', example='Success'),
}

model GetSingleDocumentExtractResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSingleDocumentExtractResultResponseBody(name='body'),
}

async function getSingleDocumentExtractResultWithOptions(request: GetSingleDocumentExtractResultRequest, runtime: Util.RuntimeOptions): GetSingleDocumentExtractResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSingleDocumentExtractResult',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSingleDocumentExtractResult(request: GetSingleDocumentExtractResultRequest): GetSingleDocumentExtractResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSingleDocumentExtractResultWithOptions(request, runtime);
}

model ReClassifyTradeDocumentExtractRequest {
  bizId?: string(name='BizId'),
  pageUpdateInfoModels?: [ 
    {
      attTypeCode?: string(name='AttTypeCode'),
      pageId?: string(name='PageId'),
    }
  ](name='PageUpdateInfoModels'),
}

model ReClassifyTradeDocumentExtractShrinkRequest {
  bizId?: string(name='BizId'),
  pageUpdateInfoModelsShrink?: string(name='PageUpdateInfoModels'),
}

model ReClassifyTradeDocumentExtractResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model ReClassifyTradeDocumentExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReClassifyTradeDocumentExtractResponseBody(name='body'),
}

async function reClassifyTradeDocumentExtractWithOptions(tmpReq: ReClassifyTradeDocumentExtractRequest, runtime: Util.RuntimeOptions): ReClassifyTradeDocumentExtractResponse {
  Util.validateModel(tmpReq);
  var request = new ReClassifyTradeDocumentExtractShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.pageUpdateInfoModels)) {
    request.pageUpdateInfoModelsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.pageUpdateInfoModels, 'PageUpdateInfoModels', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.pageUpdateInfoModelsShrink)) {
    query['PageUpdateInfoModels'] = request.pageUpdateInfoModelsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReClassifyTradeDocumentExtract',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reClassifyTradeDocumentExtract(request: ReClassifyTradeDocumentExtractRequest): ReClassifyTradeDocumentExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  return reClassifyTradeDocumentExtractWithOptions(request, runtime);
}

model RetryTradeDocumentExtractRequest {
  bizId?: string(name='BizId'),
}

model RetryTradeDocumentExtractResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model RetryTradeDocumentExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RetryTradeDocumentExtractResponseBody(name='body'),
}

async function retryTradeDocumentExtractWithOptions(request: RetryTradeDocumentExtractRequest, runtime: Util.RuntimeOptions): RetryTradeDocumentExtractResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RetryTradeDocumentExtract',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function retryTradeDocumentExtract(request: RetryTradeDocumentExtractRequest): RetryTradeDocumentExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  return retryTradeDocumentExtractWithOptions(request, runtime);
}

model SubmitAirWaybillExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitAirWaybillExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitAirWaybillExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitAirWaybillExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitAirWaybillExtractJobResponseBody(name='body'),
}

async function submitAirWaybillExtractJobWithOptions(request: SubmitAirWaybillExtractJobRequest, runtime: Util.RuntimeOptions): SubmitAirWaybillExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitAirWaybillExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitAirWaybillExtractJob(request: SubmitAirWaybillExtractJobRequest): SubmitAirWaybillExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitAirWaybillExtractJobWithOptions(request, runtime);
}

async function submitAirWaybillExtractJobAdvance(request: SubmitAirWaybillExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitAirWaybillExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitAirWaybillExtractJobReq = new SubmitAirWaybillExtractJobRequest{};
  OpenApiUtil.convert(request, submitAirWaybillExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitAirWaybillExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitAirWaybillExtractJobResp = submitAirWaybillExtractJobWithOptions(submitAirWaybillExtractJobReq, runtime);
  return submitAirWaybillExtractJobResp;
}

model SubmitBillOfLadingExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitBillOfLadingExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitBillOfLadingExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitBillOfLadingExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitBillOfLadingExtractJobResponseBody(name='body'),
}

async function submitBillOfLadingExtractJobWithOptions(request: SubmitBillOfLadingExtractJobRequest, runtime: Util.RuntimeOptions): SubmitBillOfLadingExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitBillOfLadingExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitBillOfLadingExtractJob(request: SubmitBillOfLadingExtractJobRequest): SubmitBillOfLadingExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitBillOfLadingExtractJobWithOptions(request, runtime);
}

async function submitBillOfLadingExtractJobAdvance(request: SubmitBillOfLadingExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitBillOfLadingExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitBillOfLadingExtractJobReq = new SubmitBillOfLadingExtractJobRequest{};
  OpenApiUtil.convert(request, submitBillOfLadingExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitBillOfLadingExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitBillOfLadingExtractJobResp = submitBillOfLadingExtractJobWithOptions(submitBillOfLadingExtractJobReq, runtime);
  return submitBillOfLadingExtractJobResp;
}

model SubmitBookingNoteExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitBookingNoteExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitBookingNoteExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitBookingNoteExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitBookingNoteExtractJobResponseBody(name='body'),
}

async function submitBookingNoteExtractJobWithOptions(request: SubmitBookingNoteExtractJobRequest, runtime: Util.RuntimeOptions): SubmitBookingNoteExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitBookingNoteExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitBookingNoteExtractJob(request: SubmitBookingNoteExtractJobRequest): SubmitBookingNoteExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitBookingNoteExtractJobWithOptions(request, runtime);
}

async function submitBookingNoteExtractJobAdvance(request: SubmitBookingNoteExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitBookingNoteExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitBookingNoteExtractJobReq = new SubmitBookingNoteExtractJobRequest{};
  OpenApiUtil.convert(request, submitBookingNoteExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitBookingNoteExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitBookingNoteExtractJobResp = submitBookingNoteExtractJobWithOptions(submitBookingNoteExtractJobReq, runtime);
  return submitBookingNoteExtractJobResp;
}

model SubmitCertificateOfOriginExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitCertificateOfOriginExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitCertificateOfOriginExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitCertificateOfOriginExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitCertificateOfOriginExtractJobResponseBody(name='body'),
}

async function submitCertificateOfOriginExtractJobWithOptions(request: SubmitCertificateOfOriginExtractJobRequest, runtime: Util.RuntimeOptions): SubmitCertificateOfOriginExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitCertificateOfOriginExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitCertificateOfOriginExtractJob(request: SubmitCertificateOfOriginExtractJobRequest): SubmitCertificateOfOriginExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitCertificateOfOriginExtractJobWithOptions(request, runtime);
}

async function submitCertificateOfOriginExtractJobAdvance(request: SubmitCertificateOfOriginExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitCertificateOfOriginExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitCertificateOfOriginExtractJobReq = new SubmitCertificateOfOriginExtractJobRequest{};
  OpenApiUtil.convert(request, submitCertificateOfOriginExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitCertificateOfOriginExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitCertificateOfOriginExtractJobResp = submitCertificateOfOriginExtractJobWithOptions(submitCertificateOfOriginExtractJobReq, runtime);
  return submitCertificateOfOriginExtractJobResp;
}

model SubmitContainerLoadPlanExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitContainerLoadPlanExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitContainerLoadPlanExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitContainerLoadPlanExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitContainerLoadPlanExtractJobResponseBody(name='body'),
}

async function submitContainerLoadPlanExtractJobWithOptions(request: SubmitContainerLoadPlanExtractJobRequest, runtime: Util.RuntimeOptions): SubmitContainerLoadPlanExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitContainerLoadPlanExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitContainerLoadPlanExtractJob(request: SubmitContainerLoadPlanExtractJobRequest): SubmitContainerLoadPlanExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitContainerLoadPlanExtractJobWithOptions(request, runtime);
}

async function submitContainerLoadPlanExtractJobAdvance(request: SubmitContainerLoadPlanExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitContainerLoadPlanExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitContainerLoadPlanExtractJobReq = new SubmitContainerLoadPlanExtractJobRequest{};
  OpenApiUtil.convert(request, submitContainerLoadPlanExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitContainerLoadPlanExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitContainerLoadPlanExtractJobResp = submitContainerLoadPlanExtractJobWithOptions(submitContainerLoadPlanExtractJobReq, runtime);
  return submitContainerLoadPlanExtractJobResp;
}

model SubmitExportDeclarationSheetExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitExportDeclarationSheetExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitExportDeclarationSheetExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitExportDeclarationSheetExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitExportDeclarationSheetExtractJobResponseBody(name='body'),
}

async function submitExportDeclarationSheetExtractJobWithOptions(request: SubmitExportDeclarationSheetExtractJobRequest, runtime: Util.RuntimeOptions): SubmitExportDeclarationSheetExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitExportDeclarationSheetExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitExportDeclarationSheetExtractJob(request: SubmitExportDeclarationSheetExtractJobRequest): SubmitExportDeclarationSheetExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitExportDeclarationSheetExtractJobWithOptions(request, runtime);
}

async function submitExportDeclarationSheetExtractJobAdvance(request: SubmitExportDeclarationSheetExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitExportDeclarationSheetExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitExportDeclarationSheetExtractJobReq = new SubmitExportDeclarationSheetExtractJobRequest{};
  OpenApiUtil.convert(request, submitExportDeclarationSheetExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitExportDeclarationSheetExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitExportDeclarationSheetExtractJobResp = submitExportDeclarationSheetExtractJobWithOptions(submitExportDeclarationSheetExtractJobReq, runtime);
  return submitExportDeclarationSheetExtractJobResp;
}

model SubmitGeneralContractExtractJobRequest {
  contractModel?: string(name='ContractModel'),
  fileName?: string(name='FileName'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model SubmitGeneralContractExtractJobAdvanceRequest {
  contractModel?: string(name='ContractModel'),
  fileName?: string(name='FileName'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model SubmitGeneralContractExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitGeneralContractExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitGeneralContractExtractJobResponseBody(name='body'),
}

async function submitGeneralContractExtractJobWithOptions(request: SubmitGeneralContractExtractJobRequest, runtime: Util.RuntimeOptions): SubmitGeneralContractExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contractModel)) {
    query['ContractModel'] = request.contractModel;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitGeneralContractExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitGeneralContractExtractJob(request: SubmitGeneralContractExtractJobRequest): SubmitGeneralContractExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitGeneralContractExtractJobWithOptions(request, runtime);
}

async function submitGeneralContractExtractJobAdvance(request: SubmitGeneralContractExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitGeneralContractExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitGeneralContractExtractJobReq = new SubmitGeneralContractExtractJobRequest{};
  OpenApiUtil.convert(request, submitGeneralContractExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitGeneralContractExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitGeneralContractExtractJobResp = submitGeneralContractExtractJobWithOptions(submitGeneralContractExtractJobReq, runtime);
  return submitGeneralContractExtractJobResp;
}

model SubmitImportDeclarationSheetExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitImportDeclarationSheetExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitImportDeclarationSheetExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitImportDeclarationSheetExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitImportDeclarationSheetExtractJobResponseBody(name='body'),
}

async function submitImportDeclarationSheetExtractJobWithOptions(request: SubmitImportDeclarationSheetExtractJobRequest, runtime: Util.RuntimeOptions): SubmitImportDeclarationSheetExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitImportDeclarationSheetExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitImportDeclarationSheetExtractJob(request: SubmitImportDeclarationSheetExtractJobRequest): SubmitImportDeclarationSheetExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitImportDeclarationSheetExtractJobWithOptions(request, runtime);
}

async function submitImportDeclarationSheetExtractJobAdvance(request: SubmitImportDeclarationSheetExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitImportDeclarationSheetExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitImportDeclarationSheetExtractJobReq = new SubmitImportDeclarationSheetExtractJobRequest{};
  OpenApiUtil.convert(request, submitImportDeclarationSheetExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitImportDeclarationSheetExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitImportDeclarationSheetExtractJobResp = submitImportDeclarationSheetExtractJobWithOptions(submitImportDeclarationSheetExtractJobReq, runtime);
  return submitImportDeclarationSheetExtractJobResp;
}

model SubmitInvoiceExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitInvoiceExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitInvoiceExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitInvoiceExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitInvoiceExtractJobResponseBody(name='body'),
}

async function submitInvoiceExtractJobWithOptions(request: SubmitInvoiceExtractJobRequest, runtime: Util.RuntimeOptions): SubmitInvoiceExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitInvoiceExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitInvoiceExtractJob(request: SubmitInvoiceExtractJobRequest): SubmitInvoiceExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitInvoiceExtractJobWithOptions(request, runtime);
}

async function submitInvoiceExtractJobAdvance(request: SubmitInvoiceExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitInvoiceExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitInvoiceExtractJobReq = new SubmitInvoiceExtractJobRequest{};
  OpenApiUtil.convert(request, submitInvoiceExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitInvoiceExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitInvoiceExtractJobResp = submitInvoiceExtractJobWithOptions(submitInvoiceExtractJobReq, runtime);
  return submitInvoiceExtractJobResp;
}

model SubmitPackingListExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitPackingListExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitPackingListExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitPackingListExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitPackingListExtractJobResponseBody(name='body'),
}

async function submitPackingListExtractJobWithOptions(request: SubmitPackingListExtractJobRequest, runtime: Util.RuntimeOptions): SubmitPackingListExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitPackingListExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitPackingListExtractJob(request: SubmitPackingListExtractJobRequest): SubmitPackingListExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitPackingListExtractJobWithOptions(request, runtime);
}

async function submitPackingListExtractJobAdvance(request: SubmitPackingListExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitPackingListExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitPackingListExtractJobReq = new SubmitPackingListExtractJobRequest{};
  OpenApiUtil.convert(request, submitPackingListExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitPackingListExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitPackingListExtractJobResp = submitPackingListExtractJobWithOptions(submitPackingListExtractJobReq, runtime);
  return submitPackingListExtractJobResp;
}

model SubmitSalesConfirmationExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitSalesConfirmationExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitSalesConfirmationExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitSalesConfirmationExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitSalesConfirmationExtractJobResponseBody(name='body'),
}

async function submitSalesConfirmationExtractJobWithOptions(request: SubmitSalesConfirmationExtractJobRequest, runtime: Util.RuntimeOptions): SubmitSalesConfirmationExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSalesConfirmationExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitSalesConfirmationExtractJob(request: SubmitSalesConfirmationExtractJobRequest): SubmitSalesConfirmationExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSalesConfirmationExtractJobWithOptions(request, runtime);
}

async function submitSalesConfirmationExtractJobAdvance(request: SubmitSalesConfirmationExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitSalesConfirmationExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitSalesConfirmationExtractJobReq = new SubmitSalesConfirmationExtractJobRequest{};
  OpenApiUtil.convert(request, submitSalesConfirmationExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitSalesConfirmationExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitSalesConfirmationExtractJobResp = submitSalesConfirmationExtractJobWithOptions(submitSalesConfirmationExtractJobReq, runtime);
  return submitSalesConfirmationExtractJobResp;
}

model SubmitSeaWaybillExtractJobRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitSeaWaybillExtractJobAdvanceRequest {
  fileName?: string(name='FileName', example='example.pdf'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
  parserConfigId?: int32(name='ParserConfigId'),
}

model SubmitSeaWaybillExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitSeaWaybillExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitSeaWaybillExtractJobResponseBody(name='body'),
}

async function submitSeaWaybillExtractJobWithOptions(request: SubmitSeaWaybillExtractJobRequest, runtime: Util.RuntimeOptions): SubmitSeaWaybillExtractJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!Util.isUnset(request.parserConfigId)) {
    query['ParserConfigId'] = request.parserConfigId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSeaWaybillExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitSeaWaybillExtractJob(request: SubmitSeaWaybillExtractJobRequest): SubmitSeaWaybillExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSeaWaybillExtractJobWithOptions(request, runtime);
}

async function submitSeaWaybillExtractJobAdvance(request: SubmitSeaWaybillExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitSeaWaybillExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitSeaWaybillExtractJobReq = new SubmitSeaWaybillExtractJobRequest{};
  OpenApiUtil.convert(request, submitSeaWaybillExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitSeaWaybillExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitSeaWaybillExtractJobResp = submitSeaWaybillExtractJobWithOptions(submitSeaWaybillExtractJobReq, runtime);
  return submitSeaWaybillExtractJobResp;
}

model SubmitTradeDocumentPackageExtractJobRequest {
  customExtractionRange?: [ string ](name='CustomExtractionRange'),
  fileName?: string(name='FileName'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model SubmitTradeDocumentPackageExtractJobAdvanceRequest {
  customExtractionRange?: [ string ](name='CustomExtractionRange'),
  fileName?: string(name='FileName'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrlObject?: readable(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model SubmitTradeDocumentPackageExtractJobShrinkRequest {
  customExtractionRangeShrink?: string(name='CustomExtractionRange'),
  fileName?: string(name='FileName'),
  fileNameExtension?: string(name='FileNameExtension', example='pdf'),
  fileUrl?: string(name='FileUrl', example='https://gw.alipayobjects.com/os/basement_prod/598b9edf-5287-4065-9e36-464305c60698.pdf'),
}

model SubmitTradeDocumentPackageExtractJobResponseBody = {
  code?: string(name='Code', example='noPermission'),
  data?: {
    id?: string(name='Id', example='docmind-20220816-15bc7965'),
  }(name='Data'),
  message?: string(name='Message', example='You are not authorized to perform this operation.'),
  requestId?: string(name='RequestId', example='43A29C77-405E-4CC0-BC55-EE694AD00655'),
}

model SubmitTradeDocumentPackageExtractJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitTradeDocumentPackageExtractJobResponseBody(name='body'),
}

async function submitTradeDocumentPackageExtractJobWithOptions(tmpReq: SubmitTradeDocumentPackageExtractJobRequest, runtime: Util.RuntimeOptions): SubmitTradeDocumentPackageExtractJobResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitTradeDocumentPackageExtractJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.customExtractionRange)) {
    request.customExtractionRangeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customExtractionRange, 'CustomExtractionRange', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.customExtractionRangeShrink)) {
    query['CustomExtractionRange'] = request.customExtractionRangeShrink;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileNameExtension)) {
    query['FileNameExtension'] = request.fileNameExtension;
  }
  if (!Util.isUnset(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTradeDocumentPackageExtractJob',
    version = '2022-07-29',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTradeDocumentPackageExtractJob(request: SubmitTradeDocumentPackageExtractJobRequest): SubmitTradeDocumentPackageExtractJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitTradeDocumentPackageExtractJobWithOptions(request, runtime);
}

async function submitTradeDocumentPackageExtractJobAdvance(request: SubmitTradeDocumentPackageExtractJobAdvanceRequest, runtime: Util.RuntimeOptions): SubmitTradeDocumentPackageExtractJobResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'docmind-api',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var submitTradeDocumentPackageExtractJobReq = new SubmitTradeDocumentPackageExtractJobRequest{};
  OpenApiUtil.convert(request, submitTradeDocumentPackageExtractJobReq);

  if(!Util.isUnset(request.fileUrlObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.fileUrlObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    submitTradeDocumentPackageExtractJobReq.fileUrl = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var submitTradeDocumentPackageExtractJobResp = submitTradeDocumentPackageExtractJobWithOptions(submitTradeDocumentPackageExtractJobReq, runtime);
  return submitTradeDocumentPackageExtractJobResp;
}

